package epfc.tfe.ts.service.customer;

import java.util.Collection;

import org.springframework.transaction.annotation.Transactional;

import epfc.tfe.ts.domain.Customer;
import epfc.tfe.ts.repository.CustomerDao;

public class SimpleCustomerManager implements CustomerManager {
	private CustomerDao customerDao;
	
	public void setCustomerDao(CustomerDao customerDao){
		this.customerDao = customerDao;
	}
	
	public Collection<Customer> getCustomers(){
		return this.customerDao.readAll();
	}
	
	@Transactional
	public Customer create(Customer customer){
		return this.customerDao.create(customer);
	}
	
	@Transactional
	public Customer update(Customer customer){
		return this.customerDao.update(customer);
	}

	@Override
	public Customer read(Long id) {
		return this.customerDao.read(id);
	}
	
	
}
